create table Visa
(
	 [VisaId] int identity(1, 1) primary key
	,[PartnerId] int
	,[VisaName] nvarchar(128)
	,[SortDescription] nvarchar(256)
	,[DetailDescription] nvarchar(max)
	,[CreatedBy] int
	,[CreatedDate] datetime
	,[UpdatedBy] int
	,[UpdatedDate] datetime
	,[Status] int
)
go

CREATE PROCEDURE VisaGet
	@VisaId int
AS
SELECT *
FROM [Visa]
WHERE [Visa].[VisaId] = @VisaId
GO

CREATE PROCEDURE VisaList
AS
SELECT *
FROM [Visa]
ORDER BY VisaId DESC
GO

CREATE PROCEDURE VisaInsert
	@PartnerId int
	,@VisaName nvarchar(128)
	,@SortDescription nvarchar(256)
	,@DetailDescription nvarchar(max)
	,@CreatedBy int
	,@CreatedDate datetime
	,@UpdatedBy int
	,@UpdatedDate datetime
	,@Status int
AS

INSERT INTO Visa (
	 [PartnerId]
	,[VisaName]
	,[SortDescription]
	,[DetailDescription]
	,[CreatedBy]
	,[CreatedDate]
	,[UpdatedBy]
	,[UpdatedDate]
	,[Status]
	
) VALUES (
	 @PartnerId
	,@VisaName
	,@SortDescription
	,@DetailDescription
	,@CreatedBy
	,@CreatedDate
	,@UpdatedBy
	,@UpdatedDate
	,@Status
	
)

select SCOPE_IDENTITY()
GO

CREATE PROCEDURE VisaUpdate
	@VisaId int, 
	@PartnerId int, 
	@VisaName nvarchar(128), 
	@SortDescription nvarchar(256), 
	@DetailDescription nvarchar(max), 
	@CreatedBy int, 
	@CreatedDate datetime, 
	@UpdatedBy int, 
	@UpdatedDate datetime, 
	@Status int 

AS

UPDATE Visa SET
	   [PartnerId] = @PartnerId
	   ,[VisaName] = @VisaName
	   ,[SortDescription] = @SortDescription
	   ,[DetailDescription] = @DetailDescription
	   ,[CreatedBy] = @CreatedBy
	   ,[CreatedDate] = @CreatedDate
	   ,[UpdatedBy] = @UpdatedBy
	   ,[UpdatedDate] = @UpdatedDate
	   ,[Status] = @Status
WHERE [Visa].[VisaId] = @VisaId
GO

CREATE PROCEDURE VisaDelete
	@VisaId int
AS
DELETE FROM Visa
WHERE [Visa].[VisaId] = @VisaId
GO
